<?php


namespace app\cms\community\thirdPartyApi\aliyun\lib;

class config extends \app\cms\community\thirdPartyApi\abstracts\Config
{

    protected array $config = [
        'access-key-id' => '',
        'access-key-secret' => '',
        'endpoint' => '',
        'security-token' => '',
        'is-cname' => 0,
        'request-proxy' => '',
        'options' => []
    ];

    protected string $bucket;
    // 存储对象
    protected string $object;

    public function __construct(int $type = 0, int $id = 0)
    {
        parent::__construct($type, $id);
    }

    /**
     * 设置桶
     * @param string $bucket
     * @return $this
     */
    public function setBucket(string $bucket): static
    {
        $this->bucket = $bucket;
        return $this;
    }

    /**
     * 获取桶
     * @return string
     */
    public function getBucket(): string
    {
        return $this->bucket;
    }

    /**
     * @param string $object
     * @return static
     */
    public function setObject(string $object): static
    {
        $this->object = $object;
        return $this;
    }

    /**
     * @return string
     */
    public function getObject(): string
    {
        return $this->object;
    }

    /**
     * 设置其他参数
     * @param array $options
     * @return $this
     */
    public function setOptions(array $options = []): static
    {
        $this->config['options'] = $options;
        return $this;
    }

}